package web.jzs.action;

import java.util.Map;

import Model.Admin;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import dao.AdminDAO;

public class AdminAction extends ActionSupport{
	private Admin admin;

	public Admin getAdmin() {
		return admin;
	}

	public void setAdmin(Admin admin) {
		this.admin = admin;
	}
	
	public String login()
	{
		AdminDAO admindao=new AdminDAO();
		Map<String,Object> session=ActionContext.getContext().getSession();
		if(admindao.checkAdmin(admin))
		{
			
			session.put("jzsadmin", "true");
			return SUCCESS;
		}
		/*else if(admin.getJzsadminid().equals("1314011449")&&admin.getJzsadminname().equals("jzs")&&admin.getJzsadminpassword().equals("051028"))
		{
			session.put("jzsadmin", "true");
			return SUCCESS;
		}*/
		else
		{
			session.put("jzsadminnone", "true");
		}
		return ERROR;
	}
	
	
	
}
